package com.oo.packaging_2.truck;

/**
 * Truck--${description}
 *
 * @author: Jovi
 * @createTime: 2017-04-19 15:41
 **/
public class Truck {

    private String carNo;

    private String carType;

    private String color;

    private int rent;

    private int load;

    public Truck(String carNo, String carType, String color, int rent, int load) {
        this.carNo = carNo;
        this.carType = carType;
        this.color = color;
        this.rent = rent;
        this.load = load;
    }

    public Truck() {
    }

    public String getCarNo() {
        return carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getRent() {
        return rent;
    }

    public void setRent(int rent) {
        this.rent = rent;
    }

    public int getLoad() {
        return load;
    }

    public void setLoad(int load) {
        this.load = load;
    }

    public void hire(String name, int day) {
        if (day < 0) {
            System.out.println("日期无效");
            return;
        }
        String msg = "租赁信息\n车牌号：" + getCarNo() + "\n车型：" + getCarType()
                + "\n颜色：" + getColor() + "\n载重量：" + getLoad() + "\n租车人："
                + name + "\n应付金额：" + getRent() * day;
        System.out.println(msg);
    }
}
